/*
 * Copyright 2010 Marcin Blazejewski
 *
 * This file is part of Nofate.
 *
 * Nofate is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Nofate is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Nofate. If not, see <http://www.gnu.org/licenses/>.
 *
 */


#ifndef DIALOG_H_
#define DIALOG_H_

#include <vector>

using namespace std;

#define DF_FOCUSABLE                     1
#define DF_SUBITEM                       2

typedef struct {
    const char    *txt;
    char    flags;
    char    obj_type;
    void    *obj;
} ListItem;


// dialog ret codes 
#define DRC_NONE                         0
#define DRC_CLOSE_ALL                    1
#define DRC_BACK                         2

class Dialog {
private:
    char                          focus;

    void                          focus_next(char inc);

public:
    vector<ListItem>              items;
    class Dialog                  *parent;
    char                          ret_code;
    char                          ret_selected;
    
    Dialog();
    ~Dialog();

    void                         draw();
    class Action*                process_input(class AreaMap *area);
};


#endif
